package jpb.test.util;

import jpb.CommandArg;

import static junit.framework.Assert.assertEquals;

/**
 * Utility to test contents of {@link jpb.CommandArg}s.
 *
 * @author Dariusz Kordonski
 */
public final class CommandArgAssertions {

    private CommandArgAssertions() {
        throw new AssertionError("Don't instantiate me");
    }

    public static void assertOneElementAndEquals(String expectedCommand, CommandArg actualCommand) {
        assertEquals(1, actualCommand.elements().length);
        assertEquals(expectedCommand, actualCommand.elements()[0]);
    }

    public static void assertEmptyOrNull(CommandArg actual) {
        if (actual != null) {
            assertEquals(0, actual.elements().length);
        }
    }

}
